<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
        <input type="file" accept="video/*" value="上传文件" name="fileSelect"/>
        <script>
            function uploadFiles(url, files) {
                var formData = new FormData();
                for (var i = 0, file; file = files[i]; ++i) {
                    formData.append(file.name, file);
                }
                var xhr = new XMLHttpRequest();
                xhr.open('POST', url, true);
                xhr.onload = function(e) {

                };
                xhr.send(formData);  // multipart/form-data
            }
            document.querySelector('input[type="file"]').onchange = function(e) {
                debugger;
                uploadFiles('/server', this.files);
            };
        </script>
</body>
</html>